package com.gaolang.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author DELLHL
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@ToString
public class Medicine {
    @TableId(type = IdType.AUTO)
    private Integer id;//编号
    private String name;//名称
    private String specif;//规格
    private String type;//类别
    private double price;//单价
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date periodOfValidity;//有效期
    private String image;//样品图
    private String introduce;//简介
    private Integer amount;//剩余数量
    @TableLogic
    private Integer deleted;//是否已被删除



    public Medicine(String name,String specif,String type,double price,Integer amount,String image,Date periodOfValidity,String introduce){
        this.name = name;
        this.specif = specif;
        this.type = type;
        this.amount = amount;
        this.price = price;
        this.image = image;
        this.periodOfValidity = periodOfValidity;
        this.introduce = introduce;
    }

    public Medicine(Integer id,String name,String specif,String type,double price,Integer amount,String image,Date periodOfValidity,String introduce){
        this.id = id;
        this.name = name;
        this.specif = specif;
        this.type = type;
        this.amount = amount;
        this.price = price;
        this.image = image;
        this.periodOfValidity = periodOfValidity;
        this.introduce = introduce;
    }
}
